package cn.anecansaitin.firecrafting.common.util;

public class MathHelper {
    //获取圆上均匀分布的点
    public static int[][] circle(int centerX, int centerY, int radius, int count, double offset) {
        int[][] pos = new int[count][2];
        double radian = Math.PI * 2 / count;
        for (int i = 0; i < count; i++) {
            pos[i][0] = (int) Math.floor(centerX + radius * Math.cos((radian + offset) * i));
            pos[i][1] = (int) Math.floor(centerY + radius * Math.sin((radian + offset) * i));
        }
        return pos;
    }
}
